#ifndef COMPIMG_H
#define COMPIMG_H

#include "lib.h"

namespace Library
{

//----------------------------------------------------------------------------
// Public
//
PLIBEXP pCBitmap newCompImage(const String & name);
PLIBEXP String   newCompImageDetails(const String & name);

//----------------------------------------------------------------------------
// Private
//
#define CIRH_VERSION_MAJOR		1
#define CIRH_VERSION_MINOR		0
typedef struct _CompImageResourceHeader
{
	uint16	m_version_major;
	uint16	m_version_minor;
	uint32	m_entries;
	// Immediately followed by CompImageResourceEntry structures (m_entries
	// worth to be precise).
} CompImageResourceHeader, *pCompImageResourceHeader;


// PRIVATE CompImage Alignment.  Do not use outside of compimg.cpp!
#define PRIVATE_CIA_TOP		(1L << 1)
#define PRIVATE_CIA_MIDDLE	(1L << 2)
#define PRIVATE_CIA_BOTTOM	(1L << 3)
#define PRIVATE_CIA_LEFT	(1L << 4)
#define PRIVATE_CIA_CENTER	(1L << 5)
#define PRIVATE_CIA_RIGHT	(1L << 6)
#define PRIVATE_CIA_X		(PRIVATE_CIA_LEFT | PRIVATE_CIA_CENTER | PRIVATE_CIA_RIGHT)
#define PRIVATE_CIA_Y		(PRIVATE_CIA_TOP | PRIVATE_CIA_MIDDLE | PRIVATE_CIA_BOTTOM)

// CompImage Alignment - hence CIA
#define CIA_UNKNOWN		0
#define CIA_TL			(PRIVATE_CIA_TOP    | PRIVATE_CIA_LEFT)
#define CIA_TC			(PRIVATE_CIA_TOP    | PRIVATE_CIA_CENTER)
#define CIA_TR			(PRIVATE_CIA_TOP    | PRIVATE_CIA_RIGHT)
#define CIA_ML			(PRIVATE_CIA_MIDDLE | PRIVATE_CIA_LEFT)
#define CIA_MC			(PRIVATE_CIA_MIDDLE | PRIVATE_CIA_CENTER)
#define CIA_MR			(PRIVATE_CIA_MIDDLE | PRIVATE_CIA_RIGHT)
#define CIA_BL			(PRIVATE_CIA_BOTTOM | PRIVATE_CIA_LEFT)
#define CIA_BC			(PRIVATE_CIA_BOTTOM | PRIVATE_CIA_CENTER)
#define CIA_BR			(PRIVATE_CIA_BOTTOM | PRIVATE_CIA_RIGHT)

// If you change this structure, please keep it naturally aligned to 4-byte
// boundaries.
#pragma warning(push)
#pragma warning(disable:4200)
typedef struct _CompImageResourceEntry
{
	uint32	m_size;
	uint32	m_x;
	uint32	m_y;
	uint8	m_alignment;				// CIA_xx values defined above
	uint8	__padding[3];
	char	m_name[];					// Warning C4200: zero-sized array
	// The name of the resource immediately follows (note: null-terminated).
} CompImageResourceEntry, *pCompImageResourceEntry;
#pragma warning(pop)

}; // namespace Library


#endif

//
// vim: nowrap
//
